/**
 * 
 */
package com.gr.staffpm.pages.schedule.model;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.model.Model;
import org.joda.time.DateTime;

import com.gr.staffpm.pages.schedule.ExtCalendarNav;

/**
 * @author Graham Rhodes 17 Mar 2011 20:29:17
 */
public class YearChoiceLink extends AjaxLink<DateTime> {

    private static final long serialVersionUID = 1L;
    private final ExtCalendarNav nav;

    public YearChoiceLink(String id, DateTime year, ExtCalendarNav nav) {
        super(id, new Model<DateTime>(year));
        this.nav = nav;
    }

    @Override
    public void onClick(AjaxRequestTarget target) {
        nav.updateYear((DateTime) getDefaultModelObject());
    }

}
